package gui.viewEntity;

import java.util.ArrayList;

import framework.AnnuaireCocola;
import framework.classification.entities.ClAbstractEntity;
import framework.classification.entities.ClComponent;
import framework.classification.library.AbstractClassfication;
import framework.classification.library.RPClassification;
import framework.entity.ACLComponent;
import framework.entity.ACLEntity;
import framework.entity.ACLInterface;
import gui.controller.Controller;

public class ViewACLComponent extends ViewACLEntity{

	public ViewACLComponent(ACLEntity aclEntity,
			AbstractClassfication classfication,Controller controller) {
		super(aclEntity, classfication, controller);
		// TODO Auto-generated constructor stub
		
	}

	
	@Override
	public String getDescriptionLeft() {
		// TODO Auto-generated method stub
		return "Interface Required";
	}

	
	@Override
	public String getDescriptionRight() {
		// TODO Auto-generated method stub
		return "Interface Provided";
	}


	@Override
	public  ArrayList<ClAbstractEntity> FillClassifyElement() {
		// TODO Auto-generated method stub
		if (RPClassification.MODE == classification.getmode()){
			classification.getSubstitutionComponent(aclEntity.getName());
		}
		ArrayList<ClAbstractEntity> list = new ArrayList<ClAbstractEntity>();
		for (ClAbstractEntity cl : classification.getComponents().get(aclEntity.getName())){
			list.add(cl);
		}
		return list;
	}


	

	@Override
	public ArrayList<String> getLeftParty() {
		ACLComponent aclcompo = (ACLComponent) aclEntity;
		ArrayList<String> result = new ArrayList<String>();
		for (ACLInterface inter : aclcompo.getInterfacesReq()){
			result.add(inter.getName());
		}
		return result;
	}


	@Override
	public ArrayList<String> getRightParty() {
		// TODO Auto-generated method stub
		ACLComponent aclcompo = (ACLComponent) aclEntity;
		ArrayList<String> result = new ArrayList<String>();
		for (ACLInterface inter : aclcompo.getInterfacesPro()){
			result.add(inter.getName());
		}
		return result;
	}


	


	
	
	
}
